]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dnd: Set drag actor position immediately after reparenting
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 9 Jun 2020 16:31:23 +0000 (18:31 +0200)
committerJonas Dreßler <verdre@v0yd.nl>
Wed, 17 Jun 2020 08:47:50 +0000 (10:47 +0200)
For drag actors which get reparented to the uiGroup, we currently wait
until the next input event to set the fixed position of the actor, until
that they will just be allocated their old fixed position, which is 0,
0.

So avoid drag actors flickering at the top left for one frame and
position them correctly right after reparenting.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1310

js/ui/dnd.js

index f356c03c7e83de6cefb5abf8440960008735a257..464d61bb8381d0379e0700a73e602131ae7b1f30 100644 (file)
@@ -428,6 +428,10 @@ var _Draggable = class _Draggable {
         this._dragOffsetX -= transX;
         this._dragOffsetY -= transY;
 
+        this._dragActor.set_position(
+            this._dragX + this._dragOffsetX,
+            this._dragY + this._dragOffsetY);
+
         if (this._dragActorMaxSize != undefined) {
             let [scaledWidth, scaledHeight] = this._dragActor.get_transformed_size();
             let currentSize = Math.max(scaledWidth, scaledHeight);